const Router = require('koa-router')
const { verifyToken } = require('../../middleware/verify.middleware')
const { handleAvatar } = require('./file.middleware')
const { saveAvatarInfo, avatarInfo } = require('./file.controller')

const fileRouter = new Router({ prefix: "/file" })

// 更新头像
fileRouter.patch('/avatar', verifyToken, handleAvatar, saveAvatarInfo)

// 查看头像
fileRouter.get('/avatar/:userId', avatarInfo)

module.exports = fileRouter
